package com.xyy.saas.payment.adpater.pingxx.domain;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * @author wangtianqi
 * @date 2019/10/22 19:15
 */
public class RefundDO implements Serializable {
    private static final long serialVersionUID = 9156733688374416648L;

    /**
     *退款对象 id
     */
    private String id;

    /**
     *退款的订单号
     */
    private String orderNo;


    /**
     * 退款是否成功。
     */
    private Boolean succeed;

    /**
     * 退款状态（ 同refundOrder）。
     */
    private Byte status;

    /**
     * 退款成功的时间，用 Unix 时间戳表示。
     */
    private Date timeSucceed;

    /**
     * 退款详情。
     */
    private String description;

    /**
     * 退款的错误码
     */
    private String failureCode;

    /**
     * 退款消息的描述。
     */
    private String failureMsg;

    /**
     * 退款成功时额外返回的渠道信息。
     */
    private String extra;

    /**
     * 退款单号
     */
    private String refundNo;

    /**
     * 订单号
     */
    private String payNo;

    @Getter
    @Setter
    private String channelTransactionNo;

    /**
     * 构建成功消息对象
     * @param channelRefundNo
     * @param refundNo
     * @param timeSucceed
     * @return
     */
    public static RefundDO buildSuccessCallbackMsg(String channelRefundNo, String refundNo, Date timeSucceed) {
        RefundDO refundDO = new RefundDO();
        refundDO.setId(channelRefundNo);
        refundDO.setRefundNo(refundNo);
        refundDO.setTimeSucceed(timeSucceed);
        refundDO.setSucceed(Boolean.TRUE);
        return refundDO;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }


    public Boolean getSucceed() {
        return succeed;
    }

    public void setSucceed(Boolean succeed) {
        this.succeed = succeed;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getFailureCode() {
        return failureCode;
    }

    public void setFailureCode(String failureCode) {
        this.failureCode = failureCode;
    }

    public String getFailureMsg() {
        return failureMsg;
    }

    public void setFailureMsg(String failureMsg) {
        this.failureMsg = failureMsg;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public Date getTimeSucceed() {
        return timeSucceed;
    }

    public void setTimeSucceed(Date timeSucceed) {
        this.timeSucceed = timeSucceed;
    }

    public String getRefundNo() {
        return refundNo;
    }

    public void setRefundNo(String refundNo) {
        this.refundNo = refundNo;
    }

    public String getPayNo() {
        return payNo;
    }

    public void setPayNo(String payNo) {
        this.payNo = payNo;
    }

}
